package com.myz.service.sleuth;

import brave.sampler.Sampler;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

/**
 * @author maoyz0621
 */
@SpringBootApplication
public class ServiceSleuthApplication {

    public static void main(String[] args) {
        SpringApplication.run(ServiceSleuthApplication.class, args);
    }

    /**
     * 运行java -jar zipkin-server-2.10.1-exec.jar
     * 再打开http://localhost:9411/的界面，点击Dependencies,可以发现服务的依赖关系
     * find traces,可以看到具体服务相互调用的数据：
     */
    @Bean
    public Sampler defaultSampler() {
        return Sampler.ALWAYS_SAMPLE;
    }

}
